Offline Storage
-
An object conforming to the
MGLOfflineRegion
protocol determines which resources are required by anMGLOfflinePack
object. At present, only instances ofMGLTilePyramidOfflineRegion
may be used asMGLOfflinePack
regions, but additional conforming implementations may be added in the future.Declaration
Objective-C
@protocol MGLOfflineRegion <NSObject>
-
MGLOfflineStorage implements a singleton (shared object) that manages offline packs. All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database.
See moreDeclaration
Objective-C
@interface MGLOfflineStorage : NSObject
-
A block to be called once an offline pack has been completely created and added.
Declaration
Objective-C
typedef void (^MGLOfflinePackAdditionCompletionHandler)( MGLOfflinePack *_Nullable, NSError *_Nullable)
Parameters
pack
Contains a pointer to the newly added pack, or
nil
if there was an error creating or adding the pack.error
Contains a pointer to an error object (if any) indicating why the pack could not be created or added. For a list of possible error codes, see
MGLErrorCode
. -
A block to be called with a complete list of offline packs.
Declaration
Objective-C
typedef void (^MGLOfflinePackListingCompletionHandler)( NSArray<MGLOfflinePack *> *_Nonnull, NSError *_Nullable)
Parameters
pack
Contains a pointer an array of packs, or
nil
if there was an error obtaining the packs.error
Contains a pointer to an error object (if any) indicating why the list of packs could not be obtained.
-
A block to be called once an offline pack has been completely invalidated and removed.
Declaration
Objective-C
typedef void (^MGLOfflinePackRemovalCompletionHandler)(NSError *_Nullable)
Parameters
error
Contains a pointer to an error object (if any) indicating why the pack could not be invalidated or removed.
-
An
See moreMGLOfflinePack
represents a collection of resources necessary for viewing a region offline to a local database. It provides an optionalMGLOfflinePackDelegate
object with progress updates as data or errors arrive from the server.Declaration
Objective-C
@interface MGLOfflinePack : NSObject
-
The
See moreMGLOfflinePackDelegate
protocol defines methods that a delegate of anMGLOfflinePack
object can optionally implement to be notified of any changes in the pack’s download progress and of any errors while downloading.Declaration
Objective-C
@protocol MGLOfflinePackDelegate <NSObject>
-
A structure containing information about an offline pack’s current download progress.
See moreDeclaration
Objective-C
struct MGLOfflinePackProgress {}
-
The state an offline pack is currently in.
See moreDeclaration
Objective-C
enum MGLOfflinePackState : NSInteger {}
-
An offline region defined by a style URL, geographic coordinate bounds, and range of zoom levels.
See moreDeclaration
Objective-C
@interface MGLTilePyramidOfflineRegion : NSObject <MGLOfflineRegion>